package com.linciping.useges.plugin.writer;

import com.google.gson.Gson;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDirectory;
import com.linciping.useges.plugin.bean.Res2SourceFile;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Map;

public class ProjectResUesgesWriter extends BaseJsonUsegesWriter {

    private final Map<String, List<Res2SourceFile>> map;

    private static final String FILE_NAME = "ProjectResUesges.json";

    public ProjectResUesgesWriter(Project project, PsiDirectory moduleDirectory, Map<String, List<Res2SourceFile>> map) {
        super(project, moduleDirectory);
        this.map = map;
    }

    @Override
    String getContent() {
        Gson gson = new Gson();
        return gson.toJson(map);
    }

    @Override
    protected @NotNull String getFileName() {
        return FILE_NAME;
    }
}
